Active Directory LDAP Filters

LDAP syntax filters can be used in WorkplaceManagement to query Active Directory for user imports or syncs. A filter specifies the conditions that must be met for a record to be included in the query. LDAP queries use the following syntax:

(<***AD Attribute><***comparison operator***><***value***>)
Please delete ***
The following operators can be used:

These are examples of some LDAP filters that work in WorkplaceManagement:

  • Query LDAP Filter  All user objects (default WorkplaceManagement query) (&(objectCategory=person)(objectClass=user)) 
  •  All user objects (more efficient) (sAMAccountType=805306368)
  • Users with cn starting with "Ali" (&(objectCategory=person)(objectClass=user)(cn=Ali*)) 
  •  All users with "Ankara" set as the Office attribute (&(objectCategory=person)(objectClass=user)(office=Ankara))
  •  All direct members of a specified group (memberOf=cn=Test,ou=East,dc=Domain,dc=com)
  •  All users not direct members of a specified group (&(objectCategory=person)(objectClass=user)(!(memberOf=cn=Test,ou=East,dc=Domain,dc=com)))
  •  All users of a specified group, including nesting (&(objectCategory=person)(objectClass=user)(memberOf:1.2.840.113556.1.4.1941:=cn=Test,ou=East,dc=Domain,dc=com))

You can read more about search filter syntax here.

How to Generate a Filter (Windows Server 2012)

Filters can be generated with the help of the Active Directory Users and Computers tool. The following example will build a query to select users who have their Office location set to NY.

1. From the Server Manager Tools menu, select Active Directory Users and Computers.

2. Right click the Saved Queries folder and select New > Query.

3. Give the Query a name, then select Define Query.

4. In the Find dropdown, select Users, Contacts, and Groups.

5. Select the Advanced tab, then select Field > User > Office Location. Set the condition and value, then Add.

6. Select Add, then OK.

7. In the resulting Edit Query form, copy the Query string for use in WorkplaceManagement.

8. Select OK to save the query.

© Copyright 2024 WorkplaceManagement - All Rights Reserved

Website was created with Mobirise